package com.educhains.module.blog.persist.mybatis;


import com.educhains.module.blog.vo.Blog;
import com.educhains.module.blog.vo.BlogContent;
import com.educhains.web.util.SessionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import javax.mail.Session;
import java.util.List;

/**
 * Created by Tengda Tang on 2017/8/18.
 */
@Repository
public interface BlogMapper {
    Blog findBlog(String blogId);

    BlogContent findBlogContent(String blogId);

    List<Blog> showByPage(int start, int end);

    List<Blog> showByPageByLikes(int start, int end);

    List<Blog> showByPageByReads(int start, int end);

    List<Blog> getAllBlog();

    void addBlog(String blogId, String blogName, String userId, String summary, int isOriginal, String blogContent);

    void addReadNum(String blogId);

    void addLike(String blogId);

    void subtractLike(String blogId);

    List<Blog> getBlogListByUserIdWithLimit(@Param("userId") String userId, @Param("limit") int limit);

    List<Blog> selectBlogListLimit(@Param("blogNum") int blogNum, @Param("type")String type);
}
